<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>
<form action="<?php echo url_for('unidadfuncional/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table class="formulario" width="98%"  >
    <tbody >
      <?php echo $form->renderGlobalErrors() ?>
         <tr>
        <th width="20%"><?php echo $form['codigo']->renderLabel() ?></th>
        <td >
          <?php echo $form['codigo']->renderError() ?>
          <?php echo $form['codigo'] ?>
        </td>
      </tr>
       <tr style="display: none">
        <th><?php echo $form['contribuyente_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['contribuyente_id']->renderError() ?>
          <?php echo $form['contribuyente_id'] ?>
           
        </td>
      </tr>
      <tr >
        <th width="20%" style="  font-weight: bold;color: #000">Contribuyente</th>
         <td >
         <?php if (!$form->getObject()->isNew()): ?>
             <input id="nombrecontribuyente" style = "width:90%;" readOnly="readOnly" type="text" size="20px" value="<?php echo  $form->getObject()->getContribuyente() ?>">
         <?php else: ?>
             <input id="nombrecontribuyente" style = "width:90%;" readOnly="readOnly" type="text" size="20px">
         <?php endif; ?>
         
         <a href="#"><img src="/images/ver.png" onclick="abrirVentana('<?php echo url_for("unidadfuncional/buscarContribuyente")?>','Buscar','','800','400')"></a>
        </td>
      </tr>
       <tr>
        <th ><?php echo $form['medidor']->renderLabel() ?></th>
        <td >
          <?php echo $form['medidor']->renderError() ?>
          <?php echo $form['medidor'] ?>
        </td>
      </tr>
      
      <tr style="display: none">
        <th><?php echo $form['categoria_agua_id']->renderLabel() ?></th>
         <td >
         <?php echo $form['categoria_agua_id']->renderError() ?>
          <?php echo $form['categoria_agua_id'] ?>
        </td>
      </tr>
      <tr>
          <th  style="  font-weight: bold;color: #000">Categor&iacute;a</th>
           <td >  
                <?php if (!$form->getObject()->isNew()): ?>
                   <input id="nombrecategoria" style = "width:90%;" readOnly="readOnly" type="text" size="20px" value="<?php echo  $form->getObject()->getCategoriaAgua() ?>">
                <?php else: ?>
                   <input id="nombrecategoria" style = "width:90%;" readOnly="readOnly" type="text" size="20px">
               <?php endif; ?> 
               <a href="#"><img src="/images/ver.png" onclick="abrirVentana('<?php echo url_for("unidadfuncional/buscarCategoria")?>','Buscar','','800','400')"></a>
          </td>
      </tr>
            
      <tr>
          <td  colspan="3" >
              <fieldset style = "width:100%; height:150;border:solid 1px" >
                 <legend>Direccion de Servicio</legend>
                <table  width="98%"  >
                 <tr >
                   <th  style = "width:20%;"><?php echo $form['nro']->renderLabel() ?></th>
                     <td >
                      <?php echo $form['nro']->renderError() ?>
                      <?php echo $form['nro'] ?>
                      </td>
                 </tr>
                 <tr>
                  <th><?php echo $form['mbk']->renderLabel() ?></th>
                     <td >
                     <?php echo $form['mbk']->renderError() ?>
                     <?php echo $form['mbk'] ?>
                     </td>
                </tr>
                <tr>
                  <th ><?php echo $form['piso']->renderLabel() ?></th>
                     <td>
                    <?php echo $form['piso']->renderError() ?>
                    <?php echo $form['piso'] ?>
                   </td>
               </tr>
               <tr>
                  <th ><?php echo $form['dpto']->renderLabel() ?></th>
                   <td >
                    <?php echo $form['dpto']->renderError() ?>
                    <?php echo $form['dpto'] ?>
                  </td>
               </tr>
                <tr style="display: none">
        <th><?php echo $form['calle_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['calle_id']->renderError() ?>
          <?php echo $form['calle_id'] ?>
        </td>
      </tr>
       <tr>
                   
          <th style="  font-weight: bold;color: #000">Calle</th>
           <td >  
               <?php if (!$form->getObject()->isNew()): ?>
                 <input id="nombrecalle" style = "width:90%;" readOnly="readOnly" type="text" size="20px" value="<?php echo  $form->getObject()->getCalle() ?>">
               <?php else: ?>
                 <input id="nombrecalle" style = "width:90%;" readOnly="readOnly" type="text" size="20px" >
               <?php endif; ?>
               <a href="#"><img src="/images/ver.png" onclick="abrirVentana('<?php echo url_for("unidadfuncional/buscarCalle")?>','Buscar','','800','400')"></a>
          </td>
      </tr>
        <tr style="display: none">
        <th><?php echo $form['barrio_id']->renderLabel() ?></th>
         <td >
          <?php echo $form['barrio_id']->renderError() ?>
          <?php echo $form['barrio_id'] ?>
        </td>
      </tr>
      <tr>
          <th style="  font-weight: bold;color: #000">Barrio</th>
           <td>  
               <?php if (!$form->getObject()->isNew()): ?>
                  <input id="nombrebarrio" style = "width:90%;" readOnly="readOnly" type="text" size="20px" value="<?php echo  $form->getObject()->getBarrio()?>">
               <?php else: ?>
                  <input id="nombrebarrio" style = "width:90%;" readOnly="readOnly" type="text" size="20px">
               <?php endif; ?>
               <a href="#"><img src="/images/ver.png" onclick="abrirVentana('<?php echo url_for("unidadfuncional/buscarBarrio")?>','Buscar','','800','400')"></a>
          </td>
      </tr>
            </table>
           </fieldset>
      </td>
      </tr>
      
      
     
    </tbody>
     <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
          &nbsp;<a style=" text-decoration:none;   "href="<?php echo url_for('unidadfuncional/index') ?>">Volver</a>
         
          <input type="submit" value="Aceptar" onmouseover="style.cursor=cursor"/>
        </td>
      </tr>
    </tfoot>
  </table>
</form>
